<script>
$(document).ready(function() {
	var myVal = <?php echo $this->arrParams['line_per_page'];?>;
	$("select#line_per_page option")
	   .each(function() {this.selected = (this.text == myVal); });
});
</script>

<?php if ($this->totalItemCount):?>

<?php 
	unset($this->arrParams["module"]);
	unset($this->arrParams["module"]);
	unset($this->arrParams["action"]);
	unset($this->arrParams["submit"]);
	unset($this->arrParams["page"]);
	//echo $this->url($this->arrParams);
?>
	
	<div class="pagination pagination-right">
		<ul style="width: 1000px;height: 30px;box-shadow: none;">
		<li style="float: left;line-height: 30px;padding: 0px 20px;background: #F9F9F9;height: 30px;border-bottom-left-radius: 5px;">Số dòng hiển thị</li>
		<li>
		
		<form style="float:left" name="load_row" action="" method="POST">
		<select id="line_per_page" name="line_per_page" style="float:left" class="form-control" OnChange ="document.load_row.submit()">
  			<option value="10">10</option>
  			<option value="20">20</option>
 			<option value="50">50</option>
 			<option value="100">100</option>
		</select>
		<?php
			  if(!isset($this->arrParams['Title'])) {
			      $this->arrParams['Title']=0;
			  	  $this->arrParams['type']=0;
			  	  $this->arrParams['time_search']=4;
			  	  $this->arrParams['Starttime']="";
			  	  $this->arrParams['Endtime']="";
			  	  $this->arrParams['search']="";
		?>
		<input type="hidden" name="Title" value="<?php echo $this->arrParams['Title'];?>" >
		<input type="hidden" name="type" value="<?php echo $this->arrParams['type'];?>" >
		<input type="hidden" name="time_search" value="<?php echo $this->arrParams['time_search'];?>" >
		<input type="hidden" name="Starttime" value="<?php echo $this->arrParams['Starttime'];?>" >
		<input type="hidden" name="Endtime" value="<?php echo $this->arrParams['Endtime'];?>" >
		<?php }else{?>
		<input type="hidden" name="Title" value="<?php echo $this->arrParams['Title'];?>" >
		<input type="hidden" name="type" value="<?php echo $this->arrParams['type'];?>" >
		<input type="hidden" name="search" value="<?php echo $this->arrParams['search'];?>" >
		<input type="hidden" name="time_search" value="<?php echo $this->arrParams['time_search'];?>" >
		<input type="hidden" name="Starttime" value="<?php echo $this->arrParams['Starttime'];?>" >
		<input type="hidden" name="Endtime" value="<?php echo $this->arrParams['Endtime'];?>" >
		<?php  }?>
		</form>
		</li>
		<li class="disabled"><a><?php echo $this->firstItemNumber . ' - ' . $this->lastItemNumber . '/' . $this->totalItemCount?></a></li>
			<?php if ($this->previous) :?>
				<li><a href="<?php echo $this->url($this->arrParams)?>">&laquo;</a></li>
				<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . $this->previous?>">&lsaquo;</a></li>
				<?php if ($this->current > 10) :?>
					<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . ($this->previous - 10)?>"><?php echo ($this->previous - 10) ?></a></li>
				<?php endif;?>
				<?php if ($this->previous > 1) :?>
					<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . ($this->previous - 1)?>"><?php echo ($this->previous - 1) ?></a></li>
				<?php endif;?>
				<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . $this->previous?>"><?php echo $this->previous ?></a></li>
			<?php else: ?>
				<li class="disabled"><a>&laquo;</a></li>
				<li class="disabled"><a>&lsaquo;</a></li>
			<?php endif;?>
			<li class="active"><a><?php echo $this->current?></a></li>
			<?php if ($this->next) :?>
				<li><a href="<?php echo $this->url($this->arrParams). '?page=' . $this->next?>"><?php echo $this->next ?></a></li>
				<?php if ($this->next < $this->last) :?>
					<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . ($this->next + 1)?>"><?php echo ($this->next + 1) ?></a></li>
				<?php endif;?>
				<?php if (($this->current + 10) < $this->last) :?>
					<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . ($this->next + 10)?>"><?php echo ($this->next + 10) ?></a></li>
				<?php endif;?>
				<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . $this->next?>">&rsaquo;</a></li>
				<li><a href="<?php echo $this->url($this->arrParams) . '?page=' . $this->last?>">&raquo;</a></li>
			<?php else: ?>
				<li class="disabled"><a>&rsaquo;</a></li>
				<li class="disabled"><a>&raquo;</a></li>
			<?php endif;?>
		</ul>
	</div>
<?php endif?>
